<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.xteam.ecsystem.utils.AppConfig"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

//获取文章附件路径
String articleAttachPath = AppConfig.getArticleAttachPath();
//获取文章图片路径
String articleImgPath = AppConfig.getArticleImagePath();
//获取图片实际根目录
String realpath = AppConfig.getRealPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>文章管理-文章列表</title>
		<jsp:include page="../../include/base.jsp"></jsp:include>
		<jsp:include page="../../include/common.jsp"></jsp:include>
		<script src="../../resource/kindeditor/kindeditor-min.js" type="text/javascript"></script> 
		<style type="text/css">
			html{overflow: hidden;}
			.articlesFormTab{width:100%;font-size:12px;padding-top:14px;}
			.bottomDiv{width:100%; height:60px; text-align: center;line-height:60px;}
			#delBaiImageBtn span{line-height:12px !important;font-size: 11px;}
		</style>
		<script type="text/javascript">
		    //文章图片路径
			var __articleImgPath = "<%=articleImgPath %>";
			//文章附件路径
			var __articleAttachPath = "<%=articleAttachPath %>";
			//实际根目录
			var __realpath='<%=realpath%>';
			//虚拟访问目录
			var __virpath='<%=AppConfig.getVirtualPath()%>';
		</script>
	</head>
	<body>
		<form id="articlesForm" method="post" style="width:100%;height:100%;">
			<div class="mini-fit" >
				<div id="articlesFormTab" class="mini-tabs" style="width:100%;height:100%;">
					<div title="文章基本信息">
						<table class="articlesFormTab" cellpadding="3" align="left" style="width:758px">
							<tr>
								<td align="right" width="80">文章标题：</td>
								<td>    
				                    <input name="baiTitle" class="mini-textbox" width="260" 
				                    	required="true" requiredErrorText="文章标题不能为空"/>
				                    <input id="baiState" name="baiState" class="mini-textbox" 
				                    	width="20" visible="false"/>
				                </td>
				                <td align="right">文章作者：</td>
								<td>    
				                    <input name="baiAuthor" class="mini-textbox" width="260"/>
				                </td>
							</tr>
							<tr>
				                <td align="right">文章分类：</td>
								<td>    
									<input id="queryBagTree" name="baiGroup" class="mini-treeselect"  
					        			valueField="bagId" parentField="bagParent" textField="bagName" 
					        			url="<%=path %>/getBagTreeSelect.do?type=add"
					        			width="260" popupWidth="260" required="true" onvalidation="validBagName"/>
				                </td>
				                <td align="right">文章排序：</td>
								<td>    
				                    <input name="baiOrder" class="mini-textbox" width="260" 
				                    	required="true" requiredErrorText="文章排序不能为空"/>
				                </td>
							</tr>
							<tr>
								<td align="right">上传附件：</td>
								<td>    
				                    <input id="baiAttachurl" name="baiAttachurl" class="mini-textbox" 
				                    	allowInput="false" width="213" style="float:left;margin:0 2px;"/>
				                    <span id="upload_baiAttach"></span>
				                </td>
				                <td align="right">附件名称：</td>
								<td>    
				                    <input id="baiAttachname" name="baiAttachname" class="mini-textbox" width="260"/>
				                </td>
							</tr>
							<tr>
								<td align="right">文章状态：</td>
								<td>    
									<div id="baiState" name="baiState" class="mini-radiobuttonlist" 
						    		 	repeatItems="2" repeatLayout="table" repeatDirection="horizontal"  
						    		 	textField="text" valueField="value">
									</div> 
				                </td>
								<td colspan="2">&nbsp;</td>
							</tr>
						</table>
					</div>
					<div title="文章详细描述">
						<table class="articlesFormTab" cellpadding="3" align="left">
							<tr>
								<td>
									<textarea id="baiDetail_bat" 
										style="width:100%;height:320px;"></textarea>
									<input id="baiDetail" name="baiDetail" 
										class="mini-textarea" visible="false"/>
								</td>
							</tr>
						</table>
					</div>
					<div title="文章图片管理">
						<table class="articlesFormTab" cellpadding="3" align="left">
							<tr>
								<td align="right" width="80">文章图片：</td>
								<td>    
				                    <input id="upload_baiImage" class="mini-fileupload" buttonText="浏览..."
							           	limitType="*.gif;*.jpg;*.png;*.bmp" uploadOnSelect="true" width="573px"
							           	flashUrl="<%=path %>/admin/resource/swfrpc/swfupload.swf" 
									    uploadUrl="<%=path %>/fileUploadContorller.do?uploadPath=<%=realpath+articleImgPath %>" 
									    onuploadsuccess="ArticlesFormHandler.showbaiImage"/>
									<input class="mini-button" text="删除图片" id="delBaiImageBtn" plain="false" 
						    			onclick="ArticlesFormHandler.delBaiImage" height="19" enabled="false"/>
				                </td>
							 </tr>
							 <tr>
								<td align="right">图片预览：</td>
								<td>    
	                    		   <div id="baiImageViewer" style="border:1px dashed #9DA0AA;
	                    		   		width:638px;height:290px;"></div>
	                    		   	<input class="mini-textbox" id="hidden_baiImage" 
				                   		name="baiImage" visible="false"/>
				                </td>
							 </tr>
						</table>
					</div>
				</div>
			</div>
			<div class="bottomDiv">
				<input class="mini-button" text="保存" iconCls="icon-save" plain="false" 
   					onclick="ArticlesFormHandler.saveArticleInfo"/>&nbsp;&nbsp;
   				<input class="mini-button" text="关闭" iconCls="icon-cancel" plain="false" 
   					onclick="ArticlesFormHandler.closeMiniWin"/>
			</div>
	    </form>
	</body>
	<script src="handler/ArticlesFormHandler.js" type="text/javascript"></script>
</html>
